package Tools;

import java.io.Serializable;

/**
 * 类功能描述：
 *控制处理的状态
 * @author lix
 * @date 2023/12/31
 */

public class StatusManager implements Serializable {    //用于管理操作状态


    private boolean isCreatingFigure;     //正在创建图片

    public void setCreatingFigure(boolean creatingFigure) {
        setAllStatusFalse();
        isCreatingFigure = creatingFigure;
    }

    public boolean isCreatingFigure() {
        return isCreatingFigure;
    }

    public boolean isMovingFigure() {
        return isMovingFigure;
    }

    public void setMovingFigure(boolean movingFigure) {
        isMovingFigure = movingFigure;
    }

    private boolean isMovingFigure;       //正在移动图片

    public boolean isClearingPanel() {
        return isClearingPanel;
    }

    public void setClearingPanel(boolean clearingPanel) {
        setAllStatusFalse();
        isClearingPanel = clearingPanel;
    }

    private boolean isClearingPanel;        //正在清理面板

    public void setChangingColor(boolean changingColor) {
        setAllStatusFalse();
        isChangingColor = changingColor;
    }

    public boolean isDeletingFigure() {
        return isDeletingFigure;
    }

    public void setDeletingFigure(boolean deletingFigure) {
        isDeletingFigure = deletingFigure;
    }

    private boolean isDeletingFigure;   //删除图形
    private boolean isChangingColor;        //正在改变颜色
    private boolean isChangingFillColor;    //正在改变填充颜色

    public void setFillingColor(boolean fillingColor) {
        setAllStatusFalse();
        isFillingColor = fillingColor;
    }

    private boolean isFillingColor;         //正在填充颜色

    public boolean isChangingSize() {
        return isChangingSize;
    }

    public void setChangingSize(boolean changingSize) {
        setAllStatusFalse();
        isChangingSize = changingSize;
    }

    private boolean isChangingSize;         //正在改变图形的粗细

    public boolean isStretchingFigure() {
        return isStretchingFigure;
    }

    public void setStretchingFigure(boolean stretchingFigure) {
        isStretchingFigure = stretchingFigure;
    }

    private boolean isStretchingFigure;     //正在拉伸图形

    public boolean isChangingColor() {
        return isChangingColor;
    }

    public void setOpeningFile(boolean openingFile) {
        setAllStatusFalse();
        isOpeningFile = openingFile;
    }

    private boolean isOpeningFile;
    private boolean isFillingText;          //正在填充文字

    public boolean isSavingContainer() {
        return isSavingContainer;
    }

    public void setSavingContainer(boolean savingContainer) {
        setAllStatusFalse();
        isSavingContainer = savingContainer;
    }

    private boolean isSavingContainer;

    public boolean isSelectingFigure() {
        return isSelectingFigure;
    }

    public void setSelectingFigure(boolean selectingFigure) {
        setAllStatusFalse();
        isSelectingFigure = selectingFigure;
    }

    private boolean isSelectingFigure;      //正在选择图片


    /**
     * 功能描述：
     *内部方法，把所有状态设置为false
     * @author lix
     * @date 2024/01/02
     */

    public void setAllStatusFalse() {
        //把所有状态设置为false
        isMovingFigure = false;
        isClearingPanel = false;
        isChangingColor = false;
        isChangingFillColor = false;
        isFillingColor = false;
        isChangingSize = false;
        isStretchingFigure = false;
        isFillingText = false;
        isSelectingFigure = false;
        isCreatingFigure = false;
    }




}
